

import java.io.IOException;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;


public class MaxTempMapper extends Mapper<LongWritable,Text,Text,IntWritable>{
	@Override
	protected void map(LongWritable key, Text value,Context context)
			throws IOException, InterruptedException {
		String[] line=value.toString().split(",");
		String date="";
		int dayMaxT=0;
		if(line[1].matches("[0-9]*")&&line[2].matches("[0-9]*")){
			date=line[1];
			dayMaxT=Integer.parseInt(line[2]);
			context.write(new Text(date), new IntWritable(dayMaxT));
		}
	}
}
